package com.example.leave.form;

import com.example.leave.pojo.DateTime;
import lombok.Data;

import javax.validation.constraints.NotBlank;

@Data
public class LeaveFormForm extends StartEndDateTimeForm {

    @NotBlank(message = "category不能为空")
    private String category;
    @NotBlank(message = "reason不能为空")
    private String reason;


    public LeaveFormForm() {

    }

    public DateTime getStartDateTime() {
        DateTime startDateTime = new DateTime();
        startDateTime.setDate(super.getStartDate());
        startDateTime.setTime(super.getStartTime());
        return startDateTime;
    }

    public DateTime getEndDateTime() {
        DateTime endDateTime = new DateTime();
        endDateTime.setDate(super.getEndDate());
        endDateTime.setTime(super.getEndTime());
        return endDateTime;
    }


}
